import { handleActions } from 'redux-actions'
import { ADD, REMOVE } from '../types/todo'

export default handleActions({
  [ADD] (state, action) {
    state.push(action.payload)
    return [...state]
  },
  [REMOVE] (state, action) {
    state.splice(action.payload, 1)
    return [...state]
  }
}, [
  '初始值'
])
